<?php
include_once("../config/config.inc.php");
include_once("common.php");
$id = isset($HTTP_GET_VARS['id']) ? $HTTP_GET_VARS['id'] :
	(isset($HTTP_POST_VARS['id']) ? $HTTP_POST_VARS['id'] :
	$HTTP_COOKIE_VARS['id']);
if($id)
{
$query="select * from de_photos where id=$id";
$result=mysql_query($query,$con);
if($result)
	{
	$data=mysql_result($result,0,"bindata");
	$type=mysql_result($result,0,"filetype");
	$describle=mysql_result($result,0,"describle");
	Header("Content-type:$type");
	echo $data;
	}
	else{
	echo "wrong!";echo $id;
	}
}
?>